﻿<UserControl x:Class="CPPEI.Coolzon.Theme.Fashion.MainViewControl.SelectSceneView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="800" MinHeight="400" MaxHeight="440" Width="1200">
    <UserControl.Resources>
        <ImageBrush x:Key="selected" ImageSource="/CPPEI.Coolzon.Theme.Fashion;component/Images/ziding1.png" />
        <ImageBrush x:Key="normal" ImageSource="/CPPEI.Coolzon.Theme.Fashion;component/Images/ziding2.png" />
        <ImageBrush x:Key="showing" ImageSource="/CPPEI.Coolzon.Theme.Fashion;component/Images/ziding4.png" />
        <ImageBrush x:Key="showingSub" ImageSource="/CPPEI.Coolzon.Theme.Fashion;component/Images/120fang.png" />
        <ImageBrush x:Key="loading" ImageSource="/CPPEI.Coolzon.Theme.Fashion;component/Images/Loading.png" />
        <ImageBrush x:Key="loadingSub" ImageSource="/CPPEI.Coolzon.Theme.Fashion;component/Images/LoadingSub.png" />
        <Style x:Key="btnLabel" TargetType="{x:Type Button}">
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="20"/>
            <Setter Property="FontFamily" Value="微软雅黑"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="TextBlock.TextWrapping" Value="Wrap"/>
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="Cursor" Value="Hand" />
            <Setter Property="Background" Value="{StaticResource normal}" />
            <Setter Property="Template">
                <Setter.Value>
                    <!--控件模板-->
                    <ControlTemplate TargetType="Button">
                        <!--背景色-->
                        <Border x:Name="back" CornerRadius="3">
                            <Border.Background>
                                <ImageBrush ImageSource="{Binding RelativeSource={RelativeSource TemplatedParent},Path=(Button.Background).(ImageBrush.ImageSource)}" Stretch="Fill"/>
                            </Border.Background>
                            <!--前景色及边框-->
                            <Border x:Name="fore" BorderThickness="0" CornerRadius="3" BorderBrush="#5555">
                                <ContentPresenter x:Name="content" HorizontalAlignment="Center" VerticalAlignment="Center">
                                    <ContentPresenter.Content>
                                        <TextBlock TextWrapping="Wrap" Text="{TemplateBinding  Content}" MaxWidth="100" TextAlignment="Center" ></TextBlock>
                                    </ContentPresenter.Content>
                                </ContentPresenter>
                            </Border>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter Property="Background" TargetName="back" Value="{StaticResource selected}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <!--定义按钮样式-->
        <Style x:Key="btnDisplayflow" TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                            <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid>
        <Grid >
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid x:Name="gridSelectSceneView" MinHeight="220" MaxHeight="220" Grid.Row="0">
                <Grid.Background>
                    <ImageBrush ImageSource="/CPPEI.Coolzon.Theme.Fashion;component/Images/设置背景.png" Stretch="Fill"/>
                </Grid.Background>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.1*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="0.1*"/>
                </Grid.ColumnDefinitions>
                <DockPanel Grid.Column="0" Margin="5">
                    <Button x:Name="leftLoop" Style="{StaticResource btnDisplayflow}" BorderThickness="0" 
                    Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" 
                    MouseEnter="leftLoop_MouseEnter"  MouseLeave="leftLoop_MouseLeave" Width="50" 
                    Height="50" Panel.ZIndex="2" Cursor="Hand" Opacity="0.2" TouchEnter="leftLoop_TouchEnter" TouchLeave="leftLoop_TouchLeave" Click="leftLoop_Click" PreviewMouseLeftButtonDown="leftLoop_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="leftLoop_PreviewMouseLeftButtonUp" TouchDown="leftLoop_TouchDown" TouchUp="leftLoop_TouchUp"  >
                        <Button.Background>
                            <ImageBrush ImageSource="/CPPEI.Coolzon.Theme.Fashion;component/Images/设置左.png"/>
                        </Button.Background>
                    </Button>

                </DockPanel>
                <Grid Grid.Column="1" >
                    <ScrollViewer x:Name="scrollViewer" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Disabled" HorizontalContentAlignment="Stretch" >
                        <WrapPanel x:Name="spRecord"  Grid.Row="1"  Margin="0,20,0,20" HorizontalAlignment="Center"  VerticalAlignment="Center" ItemHeight="80" ItemWidth="160" ScrollViewer.CanContentScroll="True"  Orientation="Vertical"  >
                        </WrapPanel>
                    </ScrollViewer>
                </Grid>
                <DockPanel Grid.Column="2" Margin="5">
                    <Button x:Name="rightLoop" Style="{StaticResource btnDisplayflow}" BorderThickness="0" Opacity="0.2" 
                    Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" 
                    MouseEnter="rightLoop_MouseEnter" MouseLeave="rightLoop_MouseLeave" Width="50" 
                    Height="50" Panel.ZIndex="2" Cursor="Hand" TouchEnter="rightLoop_TouchEnter" TouchLeave="rightLoop_TouchLeave"  Click="rightLoop_Click" PreviewMouseLeftButtonDown="rightLoop_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="rightLoop_PreviewMouseLeftButtonUp" TouchDown="rightLoop_TouchDown" TouchUp="rightLoop_TouchUp">
                        <Button.Background>
                            <ImageBrush ImageSource="/CPPEI.Coolzon.Theme.Fashion;component/Images/设置右.png" />
                        </Button.Background>
                    </Button>
                </DockPanel>
            </Grid>
            <Grid Name="SubGrid" Grid.Row="1"  Visibility="Visible">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="0.05*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="0.05*"/>
                </Grid.ColumnDefinitions>

                <DockPanel Grid.Column="0" >
                    <Button x:Name="leftSubLoop" Style="{StaticResource btnDisplayflow}" BorderThickness="0" 
                    Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center"  Width="50" 
                    Height="130" Panel.ZIndex="2" Cursor="Hand" Click="leftSubLoop_Click" PreviewMouseLeftButtonDown="leftSubLoop_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="leftSubLoop_PreviewMouseLeftButtonUp" TouchDown="leftSubLoop_TouchDown" TouchUp="leftSubLoop_TouchUp" MouseEnter="leftSubLoop_MouseEnter"  MouseLeave="leftSubLoop_MouseLeave"  TouchEnter="leftSubLoop_TouchEnter" TouchLeave="leftSubLoop_TouchLeave"  Opacity="0.2" >
                        <Button.Background>
                            <ImageBrush ImageSource="/CPPEI.Coolzon.Theme.Fashion;component/Images/左侧激活.png"/>
                        </Button.Background>
                    </Button>

                </DockPanel>
                <ScrollViewer x:Name="_subScrollViewer" Grid.Column="1" Padding="40,20,40,10"  HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Disabled" HorizontalContentAlignment="Stretch" >
                    <ScrollViewer.Background>
                        <ImageBrush ImageSource="/CPPEI.Coolzon.Theme.Fashion;component/Images/bg4.png" Stretch="Fill"></ImageBrush>
                    </ScrollViewer.Background>
                    <StackPanel x:Name="SubScenePanel" MinHeight="140" MaxHeight="140"   VerticalAlignment="Center" Orientation="Horizontal">
                    </StackPanel>
                </ScrollViewer>

                <DockPanel Grid.Column="2" >
                    <Button x:Name="rightSubLoop" Style="{StaticResource btnDisplayflow}" BorderThickness="0" 
                    Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"  Width="50" 
                    Height="130" Panel.ZIndex="2" Cursor="Hand"  Click="rightSubLoop_Click" PreviewMouseLeftButtonDown="rightSubLoop_PreviewMouseLeftButtonDown" PreviewMouseLeftButtonUp="rightSubLoop_PreviewMouseLeftButtonUp" TouchDown="rightSubLoop_TouchDown" TouchUp="rightSubLoop_TouchUp" MouseEnter="rightSubLoop_MouseEnter"  MouseLeave="rightSubLoop_MouseLeave"  TouchEnter="rightSubLoop_TouchEnter" TouchLeave="rightSubLoop_TouchLeave"  Opacity="0.2" >
                        <Button.Background>
                            <ImageBrush ImageSource="/CPPEI.Coolzon.Theme.Fashion;component/Images/右侧激活.png" />
                        </Button.Background>
                    </Button>
                </DockPanel>
            </Grid>
        </Grid>
    </Grid>
</UserControl>
